Skip to content

Export ts namespace from tsserver for hacky-post patching #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

jakebailey
Copy link
Owner

@jakebailey jakebailey commented Oct 3, 2022

Unlike our other exectuables, tsserver is used in web, which means that
there actually would have been a "ts" variable declared for those users
(e.g. in a web worker). It looks like VS Code needs this variable to be
declared, so change this bundle to look the same as other libraries.

Note that in Node, the IIFE will never actually return, so this can have
no effect. On web, it will return in order to yield control back to the
event loop (as on web, postMessage is used to communicate).


Please do not comment on this PR. Depending on how this set of PRs evolves, this PR's contents may change entirely based on the order of commits.

This PR is a part of a stack:

  1. Make a few changes to allow all code to be loaded as one project
  2. Explicitly reference ts namespace in tsserverlibrary
  3. Generated module conversion step - unindent
  4. Generated module conversion step - explicitify
  5. Generated module conversion step - stripNamespaces
  6. Generated module conversion step - inlineImports
  7. Generated module conversion step - .git-ignore-blame-revs
  8. Add gitlens settings suggestion
  9. Make processDiagnosticMessages generate a module
  10. Fix up linting, make lint clean
  11. Undo changes needed to load codebase into ts-morph
  12. Add JSDoc eslint rule
  13. Fix all internal JSDoc comments
  14. Convert require calls to imports
  15. Remove typescriptServices, protocol.d.ts, typescript_standalone.d.ts
  16. Get codebase building pre bundling
  17. Add build via esbuild
  18. Add dts bundling
  19. Consolidate checks that test if the current environment is Node
  20. Add ts to globalThis in run.js for convenience during debugging
  21. Rename Gulpfile to Herebyfile for improved git diff
  22. Change build system to hereby
  23. Update baselines for corrected line endings in lib files
  24. Use jsonc-parser instead of LKG compiler in build
  25. Modernize localize script, use new XML library
  26. Don't use needsUpdate for quick tasks
  27. Remove mkdirp
  28. Export ts namespace from tsserver for hacky-post patching (this PR)
  29. Directly import namespaces for improved esbuild output
  30. Ensure ts object passed to plugins contains deprecatedCompat declarations
  31. Move compiler-debug into Debug namespace, which allows the compiler to be tree shaken
  32. Remove Promise redeclaration
  33. Remove globalThisShim and globalThis modification for TypeScriptServicesFactory
  34. Disable slow CodeQL queries
  35. Remove outFiles from launch.json
  36. Remove dynamicImport and setDynamicImport

@jakebailey jakebailey force-pushed the transform-stack-commit-27 branch from ce3b98c to 1d92ee1 Compare October 3, 2022 23:34
@jakebailey jakebailey force-pushed the transform-stack-commit-28 branch from 586a05e to 5b31ac2 Compare October 3, 2022 23:34
@jakebailey jakebailey force-pushed the transform-stack-commit-27 branch from 1d92ee1 to e5d5826 Compare October 4, 2022 17:59
@jakebailey jakebailey changed the title Remove ref files from testRunner Restore self-compilation using built compiler in CI tests Oct 4, 2022
@jakebailey jakebailey force-pushed the transform-stack-commit-28 branch from 5b31ac2 to 7a5cd70 Compare October 4, 2022 18:00
@jakebailey jakebailey force-pushed the transform-stack-commit-27 branch from e5d5826 to cdac21e Compare October 4, 2022 19:06
@jakebailey jakebailey changed the title Restore self-compilation using built compiler in CI tests Add ts to globalThis for convenience during debugging Oct 4, 2022
@jakebailey jakebailey force-pushed the transform-stack-commit-28 branch from 7a5cd70 to d38dfd9 Compare October 4, 2022 19:07
@jakebailey jakebailey force-pushed the transform-stack-commit-27 branch from cdac21e to 1ecfbcf Compare October 4, 2022 19:53
@jakebailey jakebailey force-pushed the transform-stack-commit-28 branch from d38dfd9 to 9ca6bf1 Compare October 4, 2022 19:53
@jakebailey jakebailey force-pushed the transform-stack-commit-27 branch 5 times, most recently from c71f45d to a2e8cb7 Compare October 7, 2022 19:31
@jakebailey jakebailey changed the title Add ts to globalThis for convenience during debugging Temporarily disable template literals Oct 7, 2022
@jakebailey jakebailey force-pushed the transform-stack-commit-28 branch from 9ca6bf1 to 175d525 Compare October 7, 2022 19:31
@jakebailey jakebailey force-pushed the transform-stack-commit-27 branch from a2e8cb7 to 7b1db7c Compare October 7, 2022 19:36
@jakebailey jakebailey force-pushed the transform-stack-commit-28 branch from 175d525 to 14ab6a6 Compare October 7, 2022 19:36
@jakebailey jakebailey force-pushed the transform-stack-commit-27 branch from 7b1db7c to ff36738 Compare October 7, 2022 22:05
@jakebailey jakebailey force-pushed the transform-stack-commit-28 branch from 14ab6a6 to f10b875 Compare October 7, 2022 22:05
@jakebailey jakebailey force-pushed the transform-stack-commit-27 branch from ff36738 to 61928b0 Compare October 9, 2022 00:42
@jakebailey jakebailey force-pushed the transform-stack-commit-28 branch from f10b875 to d3deabd Compare October 9, 2022 00:42
@jakebailey jakebailey force-pushed the transform-stack-commit-27 branch from 61928b0 to b7adab0 Compare October 10, 2022 17:10
@jakebailey jakebailey force-pushed the transform-stack-commit-28 branch from d3deabd to f0607de Compare October 10, 2022 17:10
@jakebailey jakebailey force-pushed the transform-stack-commit-27 branch from b7adab0 to c3318c8 Compare October 10, 2022 21:05
@jakebailey jakebailey changed the title Temporarily disable template literals Add a --bundle=false variant to CI Oct 10, 2022
@jakebailey jakebailey force-pushed the transform-stack-commit-28 branch 2 times, most recently from e4bcd8e to 2925d14 Compare October 10, 2022 22:54
@jakebailey jakebailey force-pushed the transform-stack-commit-27 branch from a1f24e5 to ac72e75 Compare October 10, 2022 23:13
@jakebailey jakebailey force-pushed the transform-stack-commit-28 branch from 4a0a771 to 0708798 Compare October 24, 2022 23:15
@jakebailey jakebailey force-pushed the transform-stack-commit-27 branch from fa324cf to 42b025a Compare October 25, 2022 02:24
@jakebailey jakebailey force-pushed the transform-stack-commit-28 branch from 0708798 to 35d4b72 Compare October 25, 2022 02:24
@jakebailey jakebailey force-pushed the transform-stack-commit-27 branch from 42b025a to 31f678e Compare October 27, 2022 04:27
@jakebailey jakebailey force-pushed the transform-stack-commit-28 branch from 35d4b72 to b3b2ea3 Compare October 27, 2022 04:27
@jakebailey jakebailey force-pushed the transform-stack-commit-27 branch from 31f678e to 0b39e4c Compare October 27, 2022 17:45
@jakebailey jakebailey force-pushed the transform-stack-commit-28 branch from b3b2ea3 to 6d144e1 Compare October 27, 2022 17:45
@jakebailey jakebailey force-pushed the transform-stack-commit-27 branch from 0b39e4c to a7e9ea1 Compare October 28, 2022 02:27
@jakebailey jakebailey force-pushed the transform-stack-commit-28 branch from 6d144e1 to a27dbb6 Compare October 28, 2022 02:28
@jakebailey jakebailey force-pushed the transform-stack-commit-27 branch from a7e9ea1 to f85c56f Compare October 31, 2022 21:38
@jakebailey jakebailey force-pushed the transform-stack-commit-28 branch from a27dbb6 to cd922a6 Compare October 31, 2022 21:38
@jakebailey jakebailey force-pushed the transform-stack-commit-27 branch from f85c56f to 8365adc Compare November 2, 2022 00:48
@jakebailey jakebailey force-pushed the transform-stack-commit-28 branch from cd922a6 to 375e65c Compare November 2, 2022 00:49
@jakebailey jakebailey force-pushed the transform-stack-commit-27 branch from 8365adc to a3a8116 Compare November 2, 2022 17:00
@jakebailey jakebailey force-pushed the transform-stack-commit-28 branch from 375e65c to dbfacd0 Compare November 2, 2022 17:01
@jakebailey jakebailey force-pushed the transform-stack-commit-27 branch from a3a8116 to ccedf5c Compare November 2, 2022 19:50
@jakebailey jakebailey force-pushed the transform-stack-commit-28 branch from dbfacd0 to 7135ee3 Compare November 2, 2022 19:51
@jakebailey jakebailey force-pushed the transform-stack-commit-27 branch from ccedf5c to c735079 Compare November 6, 2022 21:53
@jakebailey jakebailey force-pushed the transform-stack-commit-28 branch from 7135ee3 to 500db6f Compare November 6, 2022 21:53
@jakebailey jakebailey force-pushed the transform-stack-commit-27 branch from c735079 to d858137 Compare November 6, 2022 21:59
@jakebailey jakebailey force-pushed the transform-stack-commit-28 branch from 500db6f to 4a472cd Compare November 6, 2022 21:59
@jakebailey jakebailey force-pushed the transform-stack-commit-27 branch from d858137 to 4df0c02 Compare November 7, 2022 03:54
@jakebailey jakebailey force-pushed the transform-stack-commit-28 branch from 4a472cd to e1fe2d4 Compare November 7, 2022 03:54
@jakebailey jakebailey force-pushed the transform-stack-commit-27 branch from 4df0c02 to 4a0be1d Compare November 7, 2022 19:28
@jakebailey jakebailey force-pushed the transform-stack-commit-28 branch from e1fe2d4 to 0d0089e Compare November 7, 2022 19:28
Unlike our other exectuables, tsserver is used in web, which means that
there actually would have been a "ts" variable declared for those users
(e.g. in a web worker). It looks like VS Code needs this variable to be
declared, so change this bundle to look the same as other libraries.

Note that in Node, the IIFE will never actually return, so this can have
no effect. On web, it will return in order to yield control back to the
event loop (as on web, postMessage is used to communicate).
@jakebailey jakebailey force-pushed the transform-stack-commit-27 branch from 4a0be1d to 37d74bb Compare November 7, 2022 21:38
@jakebailey jakebailey force-pushed the transform-stack-commit-28 branch from 0d0089e to 2607563 Compare November 7, 2022 21:38
@jakebailey jakebailey closed this Nov 7, 2022
@jakebailey jakebailey deleted the transform-stack-commit-28 branch November 7, 2022 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant